home *** CD-ROM | disk | FTP | other *** search
/ Precision Software Appli…tions Silver Collection 1 / Precision Software Applications Silver Collection Volume One (PSM) (1993).iso / tutor / dosguide.exe / HELPDOS.ZIP / GOTO.HLP < prev    next >
Text File  |  1985-09-03  |  1KB  |  30 lines

  1. -------------------------  GOTO - Batch Subcommand  ----------------------------
  2.  
  3. GOTO alters the sequence in which batch file lines are executed by "transferring
  4.    control" to the line following the specified label.
  5.  
  6. FORMAT:   GOTO label
  7.  
  8. REMARKS:
  9.  
  10.    A "label" is indicated in a batch file by a ":" followed by the label name.
  11.    GOTO transfers control (the next line to be executed) to the line following
  12.    the specified label.  If the label is not found, the batch file terminates
  13.    with the message "Label not found."  Only the first eight characters of a
  14.    label are significant, that is, only the first eight characters are used to
  15.    differentiate between similar labels.
  16.  
  17. EXAMPLE:
  18.  
  19. In this example, the replaceable parameter, %1, will be set to the name of a
  20. file.  If the file is found on disk, the GOTO Subcommand will transfer control
  21. to the label :PRINT and the next line to be executed will be PRINT %1.  If the
  22. file does not exist the next line executed will be "REM File %1 not found."
  23.  
  24.           REM Print the File if it exists
  25.           IF EXIST %1 GOTO PRINT
  26.           REM File %1 not found
  27.           PAUSE
  28.           :PRINT
  29.           PRINT %1
  30.